Skip to content

Add statement ID and session ID wherever possible#844

Merged
samikshya-db merged 3 commits into
mainfrom
samikshya-chand_data/addStatementIdToTelemetry
Jun 3, 2025
Merged

Add statement ID and session ID wherever possible#844
samikshya-db merged 3 commits into
mainfrom
samikshya-chand_data/addStatementIdToTelemetry

Conversation

@samikshya-db

@samikshya-db samikshya-db commented May 30, 2025

Copy link
Copy Markdown
Collaborator

Description

  • This is to add statement and session ID in telemetry logs.

Testing

  • Tested using driver tester, logs have statement and session ID now.

Additional Notes to the Reviewer

  • Note : removing thread local is P1 whereas launching telemetry is P0

NO_CHANGELOG=true

@samikshya-db samikshya-db marked this pull request as ready for review May 31, 2025 07:31
Comment thread src/main/java/com/databricks/jdbc/telemetry/TelemetryHelper.java Outdated
.setSqlStatementId(
statementId
.toSQLExecStatementId()) // This is because only GUID is relevant for tracking
.setSessionId(sessionId);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can sessionId be null?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, in the 2 cases :

  1. if create session fails for a reason other than auth
  2. if it is a multiThreaded call

@jprakash-db jprakash-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the changes

@samikshya-db samikshya-db merged commit 59e524b into databricks:main Jun 3, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants